import common from './common'
import paths from './paths'

const projectManageService = {};

(function (service) {
  // 项目列表查询
  service.projectManageQuery = function (queryParams) {
    return common.post(paths.projectManage.listQuery, null, queryParams)
  }

  // 项目接口分组保存
  service.projectInterfaceGroupSave = function (queryParams) {
    return common.post(paths.projectManage.interfaceGroup.save, null, queryParams)
  }

  // 项目接口分组更新
  service.projectInterfaceGroupUpdate = function (queryParams) {
    return common.post(paths.projectManage.interfaceGroup.update, null, queryParams)
  }

  // 项目接口分组删除
  service.projectInterfaceGroupDelete = function (queryParams) {
    return common.post(paths.projectManage.interfaceGroup.delete, queryParams, null)
  }

  // 项目接口分组查询
  service.projectInterfaceGroupGet = function (queryParams) {
    return common.get(paths.projectManage.interfaceGroup.get, queryParams)
  }

  // 项目接口分组查询
  service.projectInterfaceGroupQuery = function (queryParams) {
    return common.post(paths.projectManage.interfaceGroup.treeQuery, null, queryParams)
  }

  // 项目接口列表保存
  service.projectInterfaceSave = function (queryParams) {
    return common.post(paths.projectManage.interface.save, null, queryParams)
  }

  // 项目接口列表更新
  service.projectInterfaceUpdate = function (queryParams) {
    return common.post(paths.projectManage.interface.update, null, queryParams)
  }

  // 项目接口信息删除
  service.projectInterfaceDelete = function (queryParams) {
    return common.post(paths.projectManage.interface.delete, queryParams, null)
  }

  // 项目接口信息查询
  service.projectInterfaceGet = function (queryParams) {
    return common.get(paths.projectManage.interface.get, queryParams)
  }

  // 项目接口列表查询
  service.projectInterfaceQuery = function (queryParams) {
    return common.get(paths.projectManage.interface.listQuery, queryParams)
  }

  // 项目接口状态查询
  service.projectInterfaceStateQuery = function () {
    return common.get(paths.projectManage.interface.stateQuery)
  }

  // 项目接口详情
  service.projectInterfaceDetail = function (queryParams) {
    return common.post(paths.projectManage.interface.listQuery, null, queryParams)
  }
})(projectManageService)

export default projectManageService;
